Skip to content

Revert "Properly handle execution time<->energy conversion in v8 host (#4884)"#4927

Merged
joshua-spacetime merged 3 commits into
masterfrom
jdetter/revert-4844
May 28, 2026
Merged

Revert "Properly handle execution time<->energy conversion in v8 host (#4884)"#4927
joshua-spacetime merged 3 commits into
masterfrom
jdetter/revert-4844

Conversation

@jdetter
Copy link
Copy Markdown
Contributor

@jdetter jdetter commented May 1, 2026

Description of Changes

This reverts commit 458eac8.

This rolls back a pricing change that we made to V8 (TypeScript) based modules. This will be applied as a hotfix to 2.2.0.

API and ABI breaking changes

None

Expected complexity level and risk

1 - Just a pricing change.

Testing

  • Tested on staging - I didn't verify that the energy used went down because I don't think I can do that on staging but at least I know this doesn't appear to break anything.

@jdetter
Copy link
Copy Markdown
Contributor Author

jdetter commented May 1, 2026

Just closing this for now, @coolreader18 says they have a better fix for this.

Copy link
Copy Markdown
Contributor

@joshua-spacetime joshua-spacetime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless @coolreader18 has strong objections, I would say let's merge this now in order to land the fix in master. And we can merge #4930 as a follow up.

@joshua-spacetime
Copy link
Copy Markdown
Contributor

I'm going to merge this since we already know it fixes energy usage.

@joshua-spacetime joshua-spacetime added this pull request to the merge queue May 28, 2026
Merged via the queue into master with commit f23eb15 May 28, 2026
49 of 51 checks passed
pull Bot pushed a commit to Abaso007/SpacetimeDB that referenced this pull request Jun 3, 2026
# Description of Changes

A sort of followup to/unrevert of clockworklabs#4884, an alternative to clockworklabs#4927.

In clockworklabs#3832, we made FunctionBudget a different unit than EnergyQuanta, but
there were still many places where we treated them the same and directly
converted between them. I got confused by that in clockworklabs#4884, and now this PR
properly separates them and corrects the v8 energy calculation.

Also, since we now benchmark the same module in rust and typescript in
the form of the keynote benchmark, this patch adds a new assertion to
that test that the fuel usage of both modules is within 2X of each
other.

# Expected complexity level and risk

3 - touches energy calculation without reverting the problematic clockworklabs#4884,
but I'm confident it's correct this time.

# Testing

- [x] Verified that the conversion factors make sense for wasmtime and
for v8.
- [x] Assert that typescript and rust keynote bench runs have similar
cpu usage

---------

Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants